﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageINews.aspx.cs" Inherits="Manageweb_ManageINews_ManageINews" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    
<link href="../images/css.css" rel="stylesheet" type="text/css" />
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table border="1" cellpadding="0" cellspacing="0" width="750">
            <tr>
                <td style="font-weight: bold; color: white; background-color: #507cd1; text-align: left">
                    &nbsp;管理图文</td>
            </tr>
        </table>
        <br />
        <table border="1" cellpadding="0" cellspacing="0" width="750">
            <tr>
                <td style="width: 50%; text-align: left">
                    &nbsp;<asp:TextBox ID="TB_Search" runat="server" Width="240px"></asp:TextBox>
                    <asp:Button ID="Btn_Search" runat="server" OnClick="Btn_Search_Click" Text="搜索" ValidationGroup="Btn_Search" />
                    <asp:RequiredFieldValidator ID="RFV_TB_Search" runat="server" ControlToValidate="TB_Search"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Search"></asp:RequiredFieldValidator></td>
                <td style="text-align: left">
                    &nbsp;<asp:DropDownList ID="DDL_Class" runat="server" Width="240px">
                    </asp:DropDownList>
                    <asp:Button ID="Btn_AddNews" runat="server" OnClick="Btn_AddNews_Click" Text="添加图文"
                        ValidationGroup="Btn_AddNews" />
                    <asp:RequiredFieldValidator ID="RFV_DDL_Class" runat="server" ControlToValidate="DDL_Class"
                        Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_AddNews"></asp:RequiredFieldValidator></td>
            </tr>
        </table>
        <br />
        <asp:Label ID="LB_ManageINews" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red"></asp:Label>
        <table border="1" cellpadding="0" cellspacing="0" width="750">
            <tr>
                <td>
                    <asp:GridView ID="GV_INewsList" runat="server" CellPadding="4" ForeColor="#333333" GridLines="Vertical"
                        Width="100%" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ODS_INewsList" PageSize="15">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#EFF3FB" />
                        <EditRowStyle BackColor="#2461BF" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="IN_ID" HeaderText="IN_ID" InsertVisible="False" SortExpression="IN_ID"
                                Visible="False" />
                            <asp:BoundField DataField="IN_Title" HeaderText="名称" SortExpression="IN_Title" />
                            <asp:BoundField DataField="INC_Title" HeaderText="类别" SortExpression="INC_Title" />
                            <asp:TemplateField HeaderText="图片" SortExpression="IN_SmallThumb">
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" Height="60px" ImageUrl='<%# FormatThumb(Eval("IN_SmallThumb")) %>'
                                        Width="80px" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CheckBoxField DataField="IN_IsLock" HeaderText="是否锁定" SortExpression="IN_IsLock" />
                            <asp:BoundField DataField="IN_Order" HeaderText="排序" SortExpression="IN_Order" Visible="False" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LBtn_Mod" runat="server" CommandArgument='<%# Eval("IN_ID") %>'
                                        OnCommand="LBtn_Mod_Command">修改</asp:LinkButton>
                                    <asp:LinkButton ID="LBtn_Del" runat="server" CommandArgument='<%# Eval("IN_ID") %>'
                                        OnClientClick="return confirm('确认删除此图文信息？')" OnCommand="LBtn_Del_Command">删除</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="IN_DateTime" HeaderText="创建时间" SortExpression="IN_DateTime" />
                        </Columns>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ODS_INewsList" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="GetDataOrderByDateTime" TypeName="AccessDAL.INewsTableAdapters.IN_INCTableAdapter">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="false" Name="IN_IsDel" Type="Boolean" />
                            <asp:Parameter DefaultValue="false" Name="INC_IsLock" Type="Boolean" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:ObjectDataSource ID="ODS_INewsList2" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataLikeClassCode" TypeName="AccessDAL.INewsTableAdapters.IN_INCTableAdapter">
                        <SelectParameters>
                            <asp:SessionParameter Name="IN_ClassCode" SessionField="INewsClassCode" Type="String" />
                            <asp:Parameter Name="IN_IsDel" Type="Boolean" DefaultValue="false" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:ObjectDataSource ID="ODS_Search" runat="server" OldValuesParameterFormatString="original_{0}"
                        SelectMethod="GetDataLikeTitle" TypeName="AccessDAL.INewsTableAdapters.IN_INCTableAdapter">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="TB_Search" Name="IN_Title" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
